using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Pool_History_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Pool.History);

            field = type.GetField("type", flag);
            app.RegisterCLRFieldGetter(field, get_type_0);
            app.RegisterCLRFieldSetter(field, set_type_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_type_0, AssignFromStack_type_0);
            field = type.GetField("name", flag);
            app.RegisterCLRFieldGetter(field, get_name_1);
            app.RegisterCLRFieldSetter(field, set_name_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_name_1, AssignFromStack_name_1);
            field = type.GetField("point", flag);
            app.RegisterCLRFieldGetter(field, get_point_2);
            app.RegisterCLRFieldSetter(field, set_point_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_point_2, AssignFromStack_point_2);
            field = type.GetField("operation", flag);
            app.RegisterCLRFieldGetter(field, get_operation_3);
            app.RegisterCLRFieldSetter(field, set_operation_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_operation_3, AssignFromStack_operation_3);
            field = type.GetField("records", flag);
            app.RegisterCLRFieldGetter(field, get_records_4);
            app.RegisterCLRFieldSetter(field, set_records_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_records_4, AssignFromStack_records_4);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Pool.History());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Pool.History[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }



        static object get_type_0(ref object o)
        {
            return ((huqiang.Pool.History)o).type;
        }

        static StackObject* CopyToStack_type_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Pool.History)o).type;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_type_0(ref object o, object v)
        {
            ((huqiang.Pool.History)o).type = (System.String)v;
        }

        static StackObject* AssignFromStack_type_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @type = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Pool.History)o).type = @type;
            return ptr_of_this_method;
        }

        static object get_name_1(ref object o)
        {
            return ((huqiang.Pool.History)o).name;
        }

        static StackObject* CopyToStack_name_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Pool.History)o).name;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_name_1(ref object o, object v)
        {
            ((huqiang.Pool.History)o).name = (System.String)v;
        }

        static StackObject* AssignFromStack_name_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @name = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Pool.History)o).name = @name;
            return ptr_of_this_method;
        }

        static object get_point_2(ref object o)
        {
            return ((huqiang.Pool.History)o).point;
        }

        static StackObject* CopyToStack_point_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Pool.History)o).point;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_point_2(ref object o, object v)
        {
            ((huqiang.Pool.History)o).point = (System.Int32)v;
        }

        static StackObject* AssignFromStack_point_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @point = ptr_of_this_method->Value;
            ((huqiang.Pool.History)o).point = @point;
            return ptr_of_this_method;
        }

        static object get_operation_3(ref object o)
        {
            return ((huqiang.Pool.History)o).operation;
        }

        static StackObject* CopyToStack_operation_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Pool.History)o).operation;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_operation_3(ref object o, object v)
        {
            ((huqiang.Pool.History)o).operation = (System.Collections.Generic.List<System.Int32>)v;
        }

        static StackObject* AssignFromStack_operation_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Collections.Generic.List<System.Int32> @operation = (System.Collections.Generic.List<System.Int32>)typeof(System.Collections.Generic.List<System.Int32>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Pool.History)o).operation = @operation;
            return ptr_of_this_method;
        }

        static object get_records_4(ref object o)
        {
            return ((huqiang.Pool.History)o).records;
        }

        static StackObject* CopyToStack_records_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Pool.History)o).records;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_records_4(ref object o, object v)
        {
            ((huqiang.Pool.History)o).records = (System.Collections.Generic.List<System.Byte[]>)v;
        }

        static StackObject* AssignFromStack_records_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Collections.Generic.List<System.Byte[]> @records = (System.Collections.Generic.List<System.Byte[]>)typeof(System.Collections.Generic.List<System.Byte[]>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Pool.History)o).records = @records;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.Pool.History();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
